package com.xayy.health.core.enums;

import lombok.Getter;

/**
 * @author Nie
 * @version V1.0
 * @date 2023/4/27 14:12
 */
public enum AlaorithmStateEnum {
    //停止
    STOP(false, "停止"),
    //启用
    RUN(true, "启用");

    @Getter
    private Boolean code;

    @Getter
    private String name;

    AlaorithmStateEnum(Boolean code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String valueof(Integer index) {
        for (AlaorithmStateEnum alaorithmStateEnum : values()) {
            if (alaorithmStateEnum.getCode().equals(index)) {
                return alaorithmStateEnum.name;
            }
        }
        return "";
    }
}
